package mcg.android.superlista;

import mcg.android.superlista.lista.ListaListActivity;
import mcg.android.superlista.produto.CatalogOverview;
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TabHost;
import android.widget.TabHost.OnTabChangeListener;
import android.widget.TabHost.TabContentFactory;
import android.widget.TabHost.TabSpec;

public class HomeActivity extends TabActivity 
		implements OnTabChangeListener, TabContentFactory {

	protected void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);

		TabHost tabHost = getTabHost();
		
		tabHost.setOnTabChangedListener(this);

		TabSpec tabLista = tabHost.newTabSpec("Lista");
		tabLista.setIndicator("Lista", getResources().getDrawable(R.drawable.icon));
		tabLista.setContent(new Intent(this, ListaListActivity.class));
		tabHost.addTab(tabLista);
		
		TabSpec tabProduto = tabHost.newTabSpec("Produto");
		tabProduto.setIndicator("Produto", getResources().getDrawable(R.drawable.icon));
		tabProduto.setContent(new Intent(this, CatalogOverview.class));
		tabHost.addTab(tabProduto);
		
	}

	public View createTabContent(String tag) {
		return null;
	}

	public void onTabChanged(String tabId) {
		Log.i("SUPELISTA", "Trocou ABA " + tabId);

	}

}
